CC = g++
#CCFLAGS = -g -c -O
DEBUG=0
ifeq ($(DEBUG), 1)
	CCFLAGS = -g -c
else
	CCFLAGS = -c
endif
  
LDFLAGS = 

SOURCES = main.cpp test.cpp
OBJECTS = $(SOURCES:.cpp=.o)
#OBJECTS = $(subst .cpp,.o,$(SOURCES))
EXECUTABLE = main

all : $(EXECUTABLE)

$(EXECUTABLE) : $(OBJECTS)
	$(CC) $(LDFLAGS) $^ -o $@

%.o : %.cpp
	$(CC) $(CCFLAGS) $< -o $@

.PHONY : clean

clean:
	-rm -f *.o


